import type {ISearchConfig} from "@/components/PageSearch/index.vue";
import {formatDate} from "@/utils/dateUtils";

const createAtInitValue = [formatDate(), formatDate()]

const searchConfig: ISearchConfig = {
    pageName: "sys:log",
    formItems: [
        {
            type: "date-picker",
            label: "访问时间",
            prop: "createAt",
            attrs: {
                clearable: false,
                type: "daterange",
                "range-separator": "~",
                "start-placeholder": "开始时间",
                "end-placeholder": "截止时间",
                "value-format": "YYYY-MM-DD",
                style: {
                    width: "240px",
                },
            },
            initialValue: createAtInitValue
        },
        {
            type: "input",
            label: "访问人",
            prop: "username",
            attrs: {
                placeholder: "访问人",
                clearable: true,
                style: {
                    width: "200px",
                },
            },
        },
        {
            type: "input",
            label: "访问接口名称",
            prop: "name",
            attrs: {
                placeholder: "访问接口名称",
                clearable: true,
                style: {
                    width: "200px",
                },
            },
        },
        {
            type: "input",
            label: "访问url",
            prop: "url",
            attrs: {
                placeholder: "访问url",
                clearable: true,
                style: {
                    width: "200px",
                },
            },
        },
    ],
};

export default searchConfig;
